Solution A: Modify /usr/bin/java link
# which java /usr/bin/java # java -version java version "1.7.0_25" OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3) OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode) # ls -ld /usr/bin/java lrwxrwxrwx 1 root root 22 Apr 16 21:47 /usr/bin/java -> /etc/alternatives/java # rm /usr/bin/java # ln -s /guoliangDev/tools/sun-jdk/jdk1.7.0_55/bin/java /usr/bin/java # java -version java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
Solution B: Modify /etc/profile
#vi /etc/profile
Append:
export JAVA_HOME=/guoliangDev/tools/sun-jdk/jdk1.7.0_55 export PATH=$JAVA_HOME/bin:$PATH
save the file, and
source /etc/proflie
Maven Assembly Plugin Example <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.